package com.demo.seata.tcc.service;

import com.demo.seata.tcc.domain.TestLimit;
import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.BusinessActionContextParameter;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;

/**
 *
 * @author
 * @since
 */
@LocalTCC
public interface TccLimitService {
  /**
   *
   * @return
   */
  @TwoPhaseBusinessAction(name = "addLimitTry", commitMethod = "addLimitConfirm", rollbackMethod = "addLimitCancel")
  boolean addLimitTry(@BusinessActionContextParameter(paramName = "testLimit") TestLimit testLimit);

  /**
   *
   */
  boolean addLimitConfirm(BusinessActionContext context);

  /**
   *
   * @param context
   */
  boolean addLimitCancel(BusinessActionContext context);
}
